# conding = utf-8
import pytest

from config import token
from utils.extract_utils import clear_extract
from utils.requests_utils import Request


@pytest.fixture(scope="session",autouse=True)
def login():
    #清空上一次执行的用例提取的数据
    clear_extract()
    print("正在使用fixture登录.......")
    # data = {
    #     "username": "admin123",
    #     "password": "admin123"
    # }
    # path = "/admin/auth/login"
    # resp = Request().call(path=path, method="post", json=data)
    # token = resp.json()["data"]["token"]
    headers = {
        "x-access-token": token
    }
    Request().update_headers(headers)


